﻿/*
 * This software is the confidential and proprietary
 * information of NetBay
 * Such confidential information should not be disclosed
 * NetBay copyright(c) 2010
 */

#region Using
using System;
using System.Collections.Generic;
using System.Data.OracleClient;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Data.Common;
using Microsoft.Practices.EnterpriseLibrary.Data;
using NetBay.Core.DataAccess;
using System.Data;
using NetBay.Core.Extensions;
using System.Data.SqlClient;
using Rio.Framework.RioManager;

#endregion

namespace Rio.Doc.DataAccess
{
    public class DA_ItemRights
    {
            #region Enum
        /// <summary>
        /// List of DB functions to access data
        /// </summary>
        public enum DbFunction
        {
            [DescriptionAttribute("")]
            None,
            [DescriptionAttribute("P_ITEMRIGHTS_Get_ByGroupId")]
            GetItemRightsByGroup,
        }
        #endregion


        /// <summary>
        /// Retreive all itemRights from DB by groupId
        /// </summary>
        /// <param name="p_lUserId">User ID</param>
        /// <param name="p_lGroupId">Group identification</param>
        /// <returns>DataReader</returns>
        public static IDataReader GetItemRightsByGroup(long p_lUserId, long p_lGroupId)
        {
            var db = DbHelper.DataBase;
            var dbCommand = db.GetNewCommand(DbFunction.GetItemRightsByGroup.szGetDescription());
            db.AddInParameter(dbCommand, "p_userId", DbType.Int64, p_lUserId);
            db.AddInParameter(dbCommand, "p_GroupId", DbType.Int64, p_lGroupId);
            return db.ExecuteReader(dbCommand);
        }
        
    }
}

